<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生信息列表</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
    <h1>学生信息列表</h1>
    {% with messages = get_flashed_messages() %}
    {% if messages %}
    <ul class="messages">
        {% for message in messages %}
        <li>{{ message }}</li>
        {% endfor %}
    </ul>
    {% endif %}
    {% endwith %}
    <table>
        <thead>
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>所属院系</th>
                <th>班级</th>
                <th>家庭住址</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for student in students %}
            <tr>
                <td>{{ student.Sno }}</td>
                <td>{{ student.Sname }}</td>
                <td>{{ student.Ssex }}</td>
                <td>{{ student.Sage }}</td>
                <td>{{ student.Dno }}</td>
                <td>{{ student.Sclass }}</td>
                <td>{{ student.address }}</td>
                <td>
                    <a href="{{ url_for('edit_student', sno=student.SNo) }}">修改</a>
                    <a href="{{ url_for('delete_student', sno=student.SNo) }}">删除</a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
    <a href="{{ url_for('add_student') }}">添加</a>
</body>
</html>